package com.pansoft.openplanet.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.pansoft.newasset.fragment.NewAssetCardsFragment;
import com.pansoft.openplanet.R;
import com.pansoft.openplanet.bean.CardBean;
import com.pansoft.openplanet.util.TCStringUtil;


/**
 * 新版卡片列表适配器
 */
public class NewCardStackAdapter extends BaseQuickAdapter<CardBean, BaseViewHolder> {


    public NewCardStackAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, CardBean item) {
        helper.setImageDrawable(R.id.iv_bg, NewAssetCardsFragment.getCardTypeBackgroundDrawable(mContext, item.getCardType()));
        helper.setText(R.id.tv_card_type, CardBean.getCardTypeName(item.getCardType()));
        helper.addOnClickListener(R.id.tv_look_watch);
        helper.setText(R.id.tv_card_number, TCStringUtil.formatCardNoHide(item.getUid()));
    }
}
